#include <iostream>
#include <queue>

using namespace std;

int n, m, k;
priority_queue<int> heap; // 默认就是大根堆

int main()
{
    cin >> n >> m >> k;
    
    for(int i = 1; i <= n; i++)
    {
        int x; cin >> x;
        heap.push(x);
        if(heap.size() > k) heap.pop();
    }
    
    while(m--)
    {
        int op; cin >> op;
        if(op == 1) // 来了一个数
        {
            int x; cin >> x;
            heap.push(x);
            if(heap.size() > k) heap.pop();
        }
        else if(op == 2) // 查询第 k 小
        {
            if(heap.size() == k) cout << heap.top() << endl;
            else cout << -1 << endl;
        }
    }
    
    return 0;
}